package main

import (
	"fmt"
	"os"
)

func makedemo1() {
	oFile := "demo1.txt"
	fout, _ := os.OpenFile(oFile, os.O_CREATE|os.O_WRONLY, os.ModeAppend)
	os.Chmod(oFile, 0664)
	defer fout.Close()
	for i := 1; i <= 200; i++ {
		fmt.Fprintf(fout, "this is line %d\n", i)
	}
}

// func main() {
func makedemo2() {
	oFile := "demo2.txt"
	fout, _ := os.OpenFile(oFile, os.O_CREATE|os.O_WRONLY, os.ModeAppend)
	os.Chmod(oFile, 0664)
	defer fout.Close()
	for i := 1; i <= 10; i++ {
		for j := 1; j <= i; j++ {
			fmt.Fprintf(fout, "this is page %d\n", i)
		}
		fmt.Fprintf(fout, "\f")
	}
}
